/*
 * @Description:
 * @Author: maxyang
 * @Date: 2022-06-05 17:54:50
 * @LastEditTime: 2022-07-17 22:12:22
 * @LastEditors: liutq
 * @Reference:
 */
package router

import (
	"github.com/gin-gonic/gin"
	"github.com/maxyang107/jinglan/controller/admin"
	"github.com/maxyang107/jinglan/middleware"
)

func LoadAdminRouter(router *gin.Engine) {

	v1 := router.Group("/api/")
	//后台登录
	v1.POST("admin/Login", admin.Login)
	//发布公告
	v1.POST("admin/addannouncement", middleware.AdminJwtAuthMiddleware(), admin.AddAnnouncement)
	//修改公告
	v1.POST("admin/modifyannouncement", middleware.AdminJwtAuthMiddleware(), admin.ModifyAnnouncement)
	//新增商品
	v1.POST("admin/addgoods", middleware.AdminJwtAuthMiddleware(), admin.AddGoods)
	//获取商品列表
	v1.GET("admin/getgoodslist", middleware.AdminJwtAuthMiddleware(), admin.GetGoodsList)
	//获取商品详情
	v1.GET("admin/getgoodsdetail", middleware.AdminJwtAuthMiddleware(), admin.GetGoodsDetail)

	//修改商品
	v1.POST("admin/modifygoods", middleware.AdminJwtAuthMiddleware(), admin.ModifyGoods)
	//获取灌水列表
	v1.GET("admin/getirrigationlist", middleware.AdminJwtAuthMiddleware(), admin.GetIrrigationList)
	//返回灌水详情
	v1.GET("admin/getirrigation", middleware.AdminJwtAuthMiddleware(), admin.GetIrrigation)
	//设置注水
	v1.POST("admin/setirrigation", middleware.AdminJwtAuthMiddleware(), admin.SetIrrigation)
	//开签
	v1.POST("admin/openDraw", middleware.AdminJwtAuthMiddleware(), admin.OpenDraw)
	//获取当前商品真实抽签人数
	v1.GET("admin/getdrawtotal", middleware.AdminJwtAuthMiddleware(), admin.GetDrawTotal)

	//获取用户列表
	v1.GET("admin/getuserlist", middleware.AdminJwtAuthMiddleware(), admin.GetUserList)
	//设置用户状态
	v1.POST("admin/setuserstatus", middleware.AdminJwtAuthMiddleware(), admin.SetUserStatus)
	//设置系统配置
	v1.POST("admin/addorupdateconfig", middleware.AdminJwtAuthMiddleware(), admin.AddOrUpdateConfig)
	//获取所有系统配置
	v1.GET("admin/getsysconfiglist", middleware.AdminJwtAuthMiddleware(), admin.GetSysConfigList)
	//获取配置详情
	v1.GET("admin/getDetail", middleware.AdminJwtAuthMiddleware(), admin.GetDetail)
	//拉取微店商品列表
	v1.GET("admin/getVshopGoodsList", middleware.AdminJwtAuthMiddleware(), admin.GetVshopGoodsList)
	//重试退款
	v1.GET("admin/retryrefound", middleware.AdminJwtAuthMiddleware(), admin.RetryRefound)
	//临时授权
	v1.GET("admin/provisionalauthorization", middleware.AdminJwtAuthMiddleware(), admin.ProvisionalAuthorization)
	//获取回购列表
	v1.GET("admin/getrepolist", middleware.AdminJwtAuthMiddleware(), admin.GetRepoList)
	//修改回购状态
	v1.POST("admin/modifyrepostatus", middleware.AdminJwtAuthMiddleware(), admin.ModifyRepoStatus)
	//新增或修改banner
	v1.POST("admin/addormodifybanner", middleware.AdminJwtAuthMiddleware(), admin.AddOrModifyBanner)

	v1.GET("admin/getbannerlist", middleware.AdminJwtAuthMiddleware(), admin.GetBannerList)

}
